package fun.coding.string;

import java.util.ArrayList;

//import org.apache.log4j.BasicConfigurator;
//import org.apache.log4j.Logger;

public class StringMain {
//	private static final Logger logger = Logger.getLogger(StringMain.class);
	
	public static void main(String[] args) {
		StringManipulation sm = new StringManipulationImpl();
//		BasicConfigurator.configure();
		
		//TODO: use Apache commons stuff
		//System.out.println(stringManipulation.removeString("goodbye", "oe"));
		/*
		System.out.println(stringManipulation.findFirstNonRepeatedChar("tearta"));
		System.out.println(stringManipulation.findFirstNonRepeatedChar("abcdedf"));
		System.out.println(stringManipulation.findFirstNonRepeatedChar("ttttttt"));
		*/
		
		//logger.info(stringManipulation.revertString("have a good day"));
	//	logger.info(stringManipulation.revertStringWord("have a good day"));
		
	//	stringManipulation.printDiffPositionBetweenTwoStrings("abc", "ab");
		/*
		String[] s = {"tea", "abcc", "cba", "eat", "ate"};
		ArrayList<String> a = stringManipulation.anagrams(s);
		for(String it : a) {
			System.out.println(it);
		}
		*/
		
		//System.out.println(stringManipulation.strStr("abcdcdef", "cde"));
		//System.out.println(stringManipulation.removeSpaceFromString("have a good day"));
		
		// The order is reversed...
		//System.out.println(sm.addTwoStrings("900", "1"));
		/*
		ArrayList<String> subset = sm.findAllSubSets("abc");
		for(String s : subset) {
		    System.out.println(s);
		}
		*/
		
		
		//System.out.println(sm.isSameCharSet("abca", "cbaa"));
		ArrayList<String> res = sm.parseIPNoDot("101001");
		for(String s : res) {
		    System.out.println(s);
		}
		
		String[] ss = {"abbd", "abc", "abcd"};
		System.out.println(sm.isEncodedStringExist(ss, "abc"));		
		
		String palindrome = "abcbab";
		System.out.println(sm.longestPalindrome(palindrome));
		
		//String duplicate = "aabcccdd";
		String duplicate = "abbbbccccd";
		System.out.println(sm.removeDuplicateOrdered(duplicate));
	}

}
